package com.ymk.cmd;

import com.ymk.base.cmd.ACmd;
import com.ymk.base.cmd.CmdSign;
import com.ymk.bo.goods.GoodsSkuBO;
import com.ymk.core.code.cmd.GoodsCmdCode;
import com.ymk.service.IGoodsSkuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

@Service
public class GoodsSkuDelCmd extends ACmd {

    @Override
    public CmdSign executeMop(HttpServletRequest request, CmdSign sign) throws Exception {
        CmdSign respSign = new CmdSign(sign);
        GoodsSkuBO reqData = super.getData(sign, GoodsSkuBO.class);

        GoodsSkuBO delGoodsSkuBO = new GoodsSkuBO();
        delGoodsSkuBO.setId(reqData.getId());
        this.GoodsSkuService.del(delGoodsSkuBO);

        return respSign;
    }

    @Override
    public String getCmdCode() {
        return GoodsCmdCode.GOODS_SKU_DEL;
    }

    @Autowired
    private IGoodsSkuService GoodsSkuService;
}